package com.ishowcode.controller;

import com.ishowcode.beans.Email;
import com.ishowcode.service.ToEmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ToEmailSender {
    @Autowired(required = false)
    private ToEmailService toEmailService;
    @GetMapping("/sendMail")
    public String ToEmail(String username){
        Email email = new Email(username, "验证码", "111");
        String message = toEmailService.commonEmail(email);

        return message;
    }
}
